#include <iostream>
using namespace std;
int main(int argc, char * argv[])
{
  int A;
  cin >> A;
  cout << (((((A/100)<((A/10)%10))&&((A/100)<(A%100)%10)&&(((A/10)%10)<(A%100)%10)))||((((A/100)>((A/10)%10))&&((A/100)>(A%100)%10)&&(((A/10)%10)>(A%100)%10))));;
  return 0;
}
